#include<stdio.h>
#include<stdlib.h>
int main()
{
	int n,i,vul,d,time;
	scanf("%d %d",&vul,&d);
	do
	{
		time=0;
		for(n=1;;n++)
		{
		   	for(i=0;i<n;i++)
			{
		       	vul=vul-d;
		       	time++;
		       	if(vul<=0)
		       		break;
			}
			if(vul<=0)
				break;
			time++;
		}
		printf("%d\n",time);
		scanf("%d %d",&vul,&d);
	}while((vul!=0 )&&(d!=0));
	return 0;
}
